package com.peak.code;

import reactor.core.publisher.Mono;

/**
 * @author likai
 * @date 2021/11/2 4:01 PM
 * @email likai9376@163.com
 * @desc mono 的使用
 */
public class Demo04 {

    public static void main(String[] args) {
        Mono<String> a1 = Mono.defer(() -> {
            Mono<String> a = Mono.just("a1");
            return a;
        });//.subscribe(System.out::println);

        Mono<String> a2 = Mono.just("a2");
        Mono.just("b1").then(a1).then(a2).subscribe(System.out::println);

    }
}
